package com.fqgj.sentry.policy.enums;

/**
 * Created with IntelliJ IDEA.
 * User: yujianfu (mr.vencnet@gmail.com)
 * Date: 2017/7/19
 * Time: 下午5:23
 */
public enum ActiveEnum {
    close(0, "未激活"),
    active(1, "激活"),

    all(2, "全部");

    private Integer type;
    private String desc;


    ActiveEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public ActiveEnum setType(int type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public ActiveEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static ActiveEnum getEnumByType(int type) {
        ActiveEnum activeEnum = null;
        for (ActiveEnum e : ActiveEnum.values()) {
            if (e.getType() == type) {
                return e;
            }
        }
        return activeEnum;
    }

}
